//
// Created by bjliuyong on 2021/6/10.
//

#include "gc_factory.h"
#include "mark_clean.h"
#include "mark_copy.h"
#include "mark_compact.h"

void GCFactory::minor_run(GC_Type gcType, MemoryChunk *memoryChunk) {
    PRINT("minor_run", __FILE_NAME__);
    switch (gcType) {

        case MARK_COMPACT: {
            MarkCompact *markCompat = new MarkCompact(memoryChunk);
            markCompat->run();
            delete markCompat;
            break;
        }
        case MARK_CLEAN: {
            MarkClean *markClean = new MarkClean(memoryChunk);
            markClean->run();
            delete markClean;
            break;

        }

        case MARK_COPY:{
            MarkCopy *makeCopy = new MarkCopy(memoryChunk);
            makeCopy->run();
            delete makeCopy;
            break;
        }
    }
}
